package com.imooc.demo;

import com.imooc.demo.entity.DeviceInfo;
import com.imooc.demo.utils.RandomHelper;

import java.io.*;

/**
 * Created by samuelwang on 2019/1/9.
 */
public class PhoneNoReader {


    public static void main(String[] args) {


        readString();


    }


    public static void readString() {

        try {
            FileReader reader = new FileReader(new File("/learndev/javaee/demotest", "cellphones.txt"));

            BufferedReader br = new BufferedReader(reader);
            RandomHelper randomHelper = new RandomHelper();
            String str = null;
            int  i = 1;
            DeviceInfo deviceInfo;
            while ((str = br.readLine()) != null) {
                System.out.println("no: " + str);
                deviceInfo = randomHelper.randomAll();
                deviceInfo.telephonyGetLine1Number = str;
                deviceInfo.pId = Integer.toString(i++);

                System.out.println("devinfo : " + deviceInfo);


            }


        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}
